<template>
    <div>
        <div>{{ state.label }}</div>
    </div>
</template>

<script lang="ts" setup>
    import {reactive, onMounted, defineProps} from "vue";

    const props = defineProps({
        modelValue: {
            type: String,
            default: "",
        },
    });

    const state = reactive({
        label: "",
        value: "",
    });
    const convert = () => {
        if (state.value == "1") {
            state.label = "是";
        } else {
            state.label = "";
        }
    }
    const init = (): void => {
        state.value = props.modelValue
        convert();
    };

    onMounted(() => {
        init();
    });
</script>
